package com.jerry.mingxing.http;

import com.google.gson.Gson;
import com.jerry.mingxing.bean.CategroyBean;

import com.jerry.mingxing.bean.ShowBean;


import com.jerry.mingxing.bean.LabelBean;

import com.jerry.mingxing.bean.StoreBean;

import com.jerry.mingxing.config.UrlConfig;

import java.util.HashMap;

import retrofit2.Call;
import retrofit2.Callback;
import retrofit2.Retrofit;
import retrofit2.converter.gson.GsonConverterFactory;

/**
 * Created by Administrator on 2016/8/31.
 */
public class HttpUtils {
    private HttpUtils(){};
    private static HttpUtils utile= new HttpUtils();
    public static HttpUtils newInstance(){
        return utile;
    }

    public void loadCategroyCategroy(Callback<CategroyBean> callback){
        Retrofit retrofit = new Retrofit.Builder().baseUrl(UrlConfig.Path.BASE_URL).addConverterFactory(GsonConverterFactory.create(new Gson())).build();
        RetrofitInter retrofitInter = retrofit.create(RetrofitInter.class);
        Call<CategroyBean> leftBeanCall = retrofitInter.loadCategroyCategroy();
        leftBeanCall.enqueue(callback);
    }
    public void loadCategroyBrand(Callback<CategroyBean> callback){
        Retrofit retrofit = new Retrofit.Builder().baseUrl(UrlConfig.Path.BASE_URL).addConverterFactory(GsonConverterFactory.create(new Gson())).build();
        RetrofitInter retrofitInter = retrofit.create(RetrofitInter.class);
        Call<CategroyBean> leftBeanCall = retrofitInter.loadCategroyBrand();
        leftBeanCall.enqueue(callback);
    }
    public void loadStoreContentKorea(Callback<StoreBean> callback){
        Retrofit retrofit = new Retrofit.Builder().baseUrl(UrlConfig.Path.BASE_URL).addConverterFactory(GsonConverterFactory.create(new Gson())).build();
        RetrofitInter retrofitInter = retrofit.create(RetrofitInter.class);
        Call<StoreBean> leftBeanCall = retrofitInter.loadStoreContentKorea();
        leftBeanCall.enqueue(callback);
    }
    public void loadStoreContentUsa(Callback<StoreBean> callback){
        Retrofit retrofit = new Retrofit.Builder().baseUrl(UrlConfig.Path.BASE_URL).addConverterFactory(GsonConverterFactory.create(new Gson())).build();
        RetrofitInter retrofitInter = retrofit.create(RetrofitInter.class);
        Call<StoreBean> leftBeanCall = retrofitInter.loadStoreContentUsa();
        leftBeanCall.enqueue(callback);
    }
    public void loadStoreContentChinese(Callback<StoreBean> callback){
        Retrofit retrofit = new Retrofit.Builder().baseUrl(UrlConfig.Path.BASE_URL).addConverterFactory(GsonConverterFactory.create(new Gson())).build();
        RetrofitInter retrofitInter = retrofit.create(RetrofitInter.class);
        Call<StoreBean> leftBeanCall = retrofitInter.loadStoreContentChinese();
        leftBeanCall.enqueue(callback);
    }
    public void loadStoreContentBeauty(Callback<StoreBean> callback){
        Retrofit retrofit = new Retrofit.Builder().baseUrl(UrlConfig.Path.BASE_URL).addConverterFactory(GsonConverterFactory.create(new Gson())).build();
        RetrofitInter retrofitInter = retrofit.create(RetrofitInter.class);
        Call<StoreBean> leftBeanCall = retrofitInter.loadStoreContentBeauty();
        leftBeanCall.enqueue(callback);
    }
    public void loadShowToday(Callback<ShowBean> callback){
        Retrofit retrofit = new Retrofit.Builder().baseUrl(UrlConfig.Path.BASE_URL).addConverterFactory(GsonConverterFactory.create(new Gson())).build();
        RetrofitInter retrofitInter = retrofit.create(RetrofitInter.class);
        Call<ShowBean> leftBeanCall = retrofitInter.loadShowToday();
        leftBeanCall.enqueue(callback);
    }
    public void loadShowUp(Callback<ShowBean> callback){
        Retrofit retrofit = new Retrofit.Builder().baseUrl(UrlConfig.Path.BASE_URL).addConverterFactory(GsonConverterFactory.create(new Gson())).build();
        RetrofitInter retrofitInter = retrofit.create(RetrofitInter.class);
        Call<ShowBean> leftBeanCall = retrofitInter.loadShowUp();
        leftBeanCall.enqueue(callback);
    }
    public void loadShowDress(Callback<ShowBean> callback){
        Retrofit retrofit = new Retrofit.Builder().baseUrl(UrlConfig.Path.BASE_URL).addConverterFactory(GsonConverterFactory.create(new Gson())).build();
        RetrofitInter retrofitInter = retrofit.create(RetrofitInter.class);
        Call<ShowBean> leftBeanCall = retrofitInter.loadShowDress();
        leftBeanCall.enqueue(callback);
    }
    public void loadShowTrousers(Callback<ShowBean> callback){
        Retrofit retrofit = new Retrofit.Builder().baseUrl(UrlConfig.Path.BASE_URL).addConverterFactory(GsonConverterFactory.create(new Gson())).build();
        RetrofitInter retrofitInter = retrofit.create(RetrofitInter.class);
        Call<ShowBean> leftBeanCall = retrofitInter.loadShowTrousers();
        leftBeanCall.enqueue(callback);
    }

    public void loadFashionLabel(Callback<LabelBean> callback){
        Retrofit retrofit = new Retrofit.Builder().baseUrl(UrlConfig.Path.BASE_URL).addConverterFactory(GsonConverterFactory.create(new Gson())).build();
        RetrofitInter retrofitInter = retrofit.create(RetrofitInter.class);
        Call<LabelBean> leftBeanCall = retrofitInter.loadFashionLabel();
        leftBeanCall.enqueue(callback);
    }


}
